/**
 * 号牌颜色 全选 组件 publicPlateColor.functions.getcar_cardcolor('cardcolor') 参数是号牌颜色div的id
 * 车身颜色 全选 组件 publicPlateColor.functions.getcar_carcolor('carcolor')  参数是车身颜色div的id
 *
 */
/**
 * html页面号牌颜色的代码
 <label class="layui-form-label">号牌颜色：</label>
 <div class="layui-input-block cardcolorspan" id="cardcolor">
 <div class="color-span-allchoose" style="margin-top: 10px;">
 <span id="card_allchoose_flag" class="color-span color-size-choose" onclick="publicPlateColor.functions.car_num_allchoose(this)" spanflag="false">
 <i class="layui-icon" style="color:white;font-size:17px;">&#xe605;</i>
 </span>
 <div style="color: #666;font-size: 14px;display:inline-block;vertical-align:top;margin-left:-5px;">全选</div>
 </div>
 <div id="numcolor">
 </div>
 </div>
 */
/**
 * * html页面车身颜色的代码
 <label class="layui-form-label">车身颜色：</label>
 <div class="layui-input-block carcolorspan" id="carcolor">
 <div class="color-span-allchoose">
 <span id="chooseall" class="color-span color-size-choose" onclick="publicPlateColor.functions.choose_car_colorAll(this);" spanflag="false">
 <i class="layui-icon" style="color:white;font-size:17px;">&#xe605;</i>
 </span>
 <span style="color: #666;font-size: 14px;display:inline-block;vertical-align:top;margin-left:-5px;">全选</span>
 </div>
 <div id="carcolor">
 </div>
 </div>
 //瀑布流懒加载 车牌颜色样式处理 以保有量页面为例
 if(row.GB_PLATE_NO != undefined){
    picHtml += publicPlateColor.functions.plateColorStyle(row.GB_PLATE_COLOR, row.GB_PLATE_NO);
 }
 //单个文件的瀑布流中图片 遮罩和下载的例子 样式在vias.css中
 picHtml +=
 '<div class="single-mask-content-div">' +
 '<a href="#" class="download-icon" onclick="inventoryObj.functions.downOneFile(\'' + row.SS_LAST_APPEAR_VEHICLE_ID + '\');layui.stope();"><i class="custom-icon">&#xe6ae;</i></a>' +
 '</div>';
 // publicPlateColor.functions.downOneFile(ssid)
 //导出文件方法
 publicPlateColor.functions.exportFile(url,param)
 //车辆详细信息
 publicPlateColor.functions.getVehicleInfo(ssid)
 */
var publicPlateColor = {
    /*后期可以改为 publicColor 用于号牌颜色、车身颜色、样式颜色*/
    functions: {
        /**
         * 号牌颜色
         * @param numcolor  号牌颜色div的id
         */
        getcar_cardcolor: function (numcolor) {
            $.ajax({
                type: 'get',
                dataType: "json",
                url: dictionary_service_url + 'FindDatailByType/PlateColor',
                data: {},
                success: function (data) {
                    if (!data) {
                        return;
                    } else if (data.length > 0) {
                        var _html = [];
                        for (var i = 0, len = data.length; i < len; i++) {
                            _html.push('<span class="cardid-color-size cardid-color' + data[i].CODE + '" onclick="publicPlateColor.functions.add_carnumcolor(this) " spanflag="false" code="' + data[i].CODE + '">' + data[i].NAME + '</span>');
                        }
                        $("#" + numcolor).append(_html.join(""));
                    }
                },
                error: function (err) {
                    console.log(err)
                }
            });
        },
        add_carnumcolor: function (carnumObj) {
            var flag = $(carnumObj).attr("spanflag");
            if (flag == "true") {
                $(carnumObj).attr("spanflag", false);
                $(carnumObj).css("box-shadow", "");
                $("#card_allchoose_flag").attr("spanflag", false);
                $("#card_allchoose_flag").removeClass('layui-form-checked');
            } else {
                var carchooseflag = true;
                $(carnumObj).attr("spanflag", true);
                $(carnumObj).css("box-shadow", "0 0 0 2px red");
                $('#numcolor span').each(function (m, n) {
                    if ($(this).attr("spanflag") == "false") {
                        carchooseflag = false;
                    }
                });
                if (carchooseflag) {
                    $('#card_allchoose_flag').attr("spanflag", true);
                    $("#card_allchoose_flag").addClass('layui-form-checked');
                }
            }
        },
        /**车身颜色*/
        getcarcolor: function (carcolor) {
            var colorarrr = [];
            $('#' + carcolor + ' span').each(function (m, n) {
                var ifchoose = $(this).attr('spanflag');
                if (ifchoose == "true") {
                    colorarrr.push($(this).attr('code'));
                }
            });
            return colorarrr.join(',');
        },
        /**车牌颜色*/
        getcardcolor: function (numcolor) {
            var colorarrr = [];
            var qx = "+";
            $('#' + numcolor + ' span').each(function (m, n) {
                var ifchoose = $(this).attr('spanflag');
                if (ifchoose == "true") {
                    colorarrr.push($(this).attr('code'));
                }
            });
            if ($("#card_allchoose_flag").attr('spanflag') == "true") {
                qx = "-";
                return qx;
            } else {
                return colorarrr.join(',');
            }
        },
        car_num_allchoose: function (cardnumObj) {
            var allflag = $(cardnumObj).attr("spanflag");
            if (allflag == "true") {
                // $('.cardcolorspan span').each(function (i, item) {
                $('#numcolor span').each(function (i, item) {
                    $(this).attr('spanflag', false);
                    $(this).css("box-shadow", "");
                });
                $(cardnumObj).attr("spanflag", false);
                $(cardnumObj).removeClass("layui-form-checked");
                $("#card_allchoose_flag").removeClass('chooseall-style');
            } else {
                // $('.cardcolorspan span').each(function (i, item) {
                $('#numcolor span').each(function (i, item) {
                    if (i != 1) {
                        $(this).attr('spanflag', true);
                        $(this).not("#card_allchoose_flag").css("box-shadow", "0 0 0 2px red");
                    }
                });
                $(cardnumObj).attr("spanflag", true);
                $(cardnumObj).addClass("layui-form-checked");
                $("#card_allchoose_flag").addClass('chooseall-style');
            }
        },
        /**
         * 车身颜色
         * @param carcolor  车身颜色div的id
         */
        getcar_carcolor: function (carcolor) {
            $.ajax({
                type: 'get',
                dataType: "json",
                url: dictionary_service_url + 'FindDatailByType/VehicleColor',
                data: {},
                success: function (data) {
                    if (!data) {
                        return;
                    } else if (data.length > 0) {
                        var _html = [];
                        for (var i = 0, len = data.length; i < len; i++) {

                            _html.push('<span data-toggle="tooltip" data-placement="top" class="color-size color-span' + data[i].CODE + '" title="' + data[i].NAME + '"  onclick="publicPlateColor.functions.hidepic(this)" spanflag="false" code="' + data[i].CODE + '">');
                            if (data[i].CODE == 2 || data[i].CODE == 6 || data[i].CODE == 0 || data[i].CODE == 99) {
                                _html.push('<i class="layui-icon" style="color:black;font-size:20px;visibility:hidden">&#xe605;</i>');
                            } else {
                                _html.push('<i class="layui-icon" style="color:white;font-size:20px;visibility:hidden">&#xe605;</i>');
                            }
                            _html.push('</span>');
                        }
                        $("#" + carcolor).append(_html.join(""));
                        $('[data-toggle="tooltip"]').tooltip();
                    }
                },
                error: function (err) {
                    console.log(err)
                }
            });
        },
        hidepic: function (picObj) {
            var flag = $(picObj).attr("spanflag");
            if (flag == "true") {
                $(picObj).find("i").css('visibility', 'hidden');
                $(picObj).attr("spanflag", false);
                $('.color-size-choose').find('i').css('visibility', 'hidden');
                $('.color-size-choose').attr("spanflag", false);
                $("#chooseall").removeClass('chooseall-style');
            } else {
                var allchooseflag = true;
                $(picObj).find("i").css('visibility', 'visible');
                $(picObj).attr("spanflag", true);
                $('#color-div span').each(function (m, n) {
                    if ($(this).attr("spanflag") == "false") {
                        allchooseflag = false;
                    }
                });
                if (allchooseflag) {
                    $('.color-size-choose').find('i').css('visibility', 'visible');
                    $('.color-size-choose').attr("spanflag", true);
                    $("#chooseall").addClass('chooseall-style');
                }
            }
        },
        /*全选-车身颜色*/
        choose_car_colorAll: function (allObj) {
            var allflag = $(allObj).attr("spanflag");
            if (allflag == "true") {
                $('.carcolorspan span').each(function (i, item) {
                    $(this).attr('spanflag', false);
                    $(this).find("i").css('visibility', 'hidden');
                });
                $("#chooseall").removeClass('chooseall-style');
            } else {
                $('.carcolorspan span').each(function (i, item) {
                    $(this).attr('spanflag', true);
                    $(this).find("i").css('visibility', 'visible');
                });
                $("#chooseall").addClass('chooseall-style');
            }
        },
        /*全选-车身颜色1*/
        choose_car_colorAll1: function (allObj) {
            var allflag = $(allObj).attr("spanflag");
            if (allflag == "true") {
                $('.carcolorspan span').each(function (i, item) {
                    $(this).attr('spanflag', false);
                    $(this).find("i").css('visibility', 'hidden');
                });
                $("#chooseallColor").removeClass('chooseall-style');
            } else {
                $('.carcolorspan span').each(function (i, item) {
                    $(this).attr('spanflag', true);
                    $(this).find("i").css('visibility', 'visible');
                });
                $("#chooseallColor").addClass('chooseall-style');
            }
        },
        /**
         * 车牌颜色处理
         * @param platecolor 号牌颜色
         * @param plateno 车辆号码
         * @returns {string}
         */
        plateColorStyle: function (platecolor, plateno) {
            var plateColorClass = "";
            if (platecolor == '5') {
                plateColorClass = "cph cph-blue plate-state-style";//号牌颜色 蓝牌
            } else if (platecolor == '9') {
                plateColorClass = "cph cph-green plate-state-style";//号牌颜色 绿牌
            } else if (platecolor == '6') {
                plateColorClass = "cph cph-yellow plate-state-style";//号牌颜色 黄牌
            } else if (platecolor == '2') {
                plateColorClass = "cph cph-white plate-state-style";//号牌颜色 白牌
            } else if (platecolor == '1') {
                plateColorClass = "cph cph-black plate-state-style";//号牌颜色 黑牌
            } else if (platecolor == '99') {
                plateColorClass = "cph cph-unknow plate-state-style";//号牌颜色 未知
            } else {
                plateColorClass = "cph cph-other plate-state-style";//号牌颜色 其他
            }
            if (plateno == '0') {
                plateno = '无车牌';
            }
            var html = '<div id="phbj" class="' + plateColorClass + '">' +
                '<div>' + plateno + '</div>' +
                '</div>';
            return html;
        },
        /**
         * 车牌颜色处理
         * @param platecolor 号牌颜色
         * @param plateno 车辆号码
         * @returns {string}
         */
        plateColorStyle: function (platecolor, plateno) {
            var plateColorClass = "";
            if (platecolor == '5') {
                plateColorClass = "cph cph-blue plate-state-style";//号牌颜色 蓝牌
            } else if (platecolor == '9') {
                plateColorClass = "cph cph-green plate-state-style";//号牌颜色 绿牌
            } else if (platecolor == '6') {
                plateColorClass = "cph cph-yellow plate-state-style";//号牌颜色 黄牌
            } else if (platecolor == '2') {
                plateColorClass = "cph cph-white plate-state-style";//号牌颜色 白牌
            } else if (platecolor == '1') {
                plateColorClass = "cph cph-black plate-state-style";//号牌颜色 黑牌
            } else if (platecolor == '99') {
                plateColorClass = "cph cph-unknow plate-state-style";//号牌颜色 未知
            } else {
                plateColorClass = "cph cph-other plate-state-style";//号牌颜色 其他
            }
            if (plateno == '0') {
                plateno = '无车牌';
            }
            var html = '<div id="phbj" class="' + plateColorClass + '">' +
                '<div>' + plateno + '</div>' +
                '</div>';
            return html;
        },
        /**
         * 车牌颜色翻译
         * @param platecolor
         * @returns {string}
         */
        plateColorTranslation: function (platecolor) {
            var result = "";
            if (platecolor == '5') {
                result = "蓝牌";
            } else if (platecolor == '9') {
                result = "绿牌";
            } else if (platecolor == '6') {
                result = "黄牌";
            } else if (platecolor == '2') {
                result = "白牌";
            } else if (platecolor == '1') {
                result = "黑牌";
            } else if (platecolor == '0') {
                result = "未知";
            } else if (platecolor == '3') {
                result = "民航黑牌";
            } else {
                result = "其他";
            }
            return result;
        },

        /**
         * 单文件下载=====后期可以删除==弃用
         * @param ssid 车要素id
         */
        // downOneFile: function (ssid) {
        //     ///vias/web/topic/inventory/moreImagesExport
        //     var url = vias_web_topic_URL + 'vias/web/topic/inventory/moreImagesExport';
        //     window.location.href = url + "?vehicleId=" + ssid;
        //
        //
        // },
        /**
         * 文件下载，可以下载单文件，或者双文件
         * @param ssidone 车要素id1
         * @param ssidtwo 车要素id1
         */
        // downDoubleFile: function (ssidone, ssidtwo) {
        //     var url = vias_web_topic_URL + 'vias/web/topic/inventory/moreImagesExport';
        //     var param = "";
        //     var flag = 0;
        //
        //     if (ssidone == undefined) {
        //         ssidone = "-1";
        //     }
        //
        //     if (ssidtwo || ssidtwo == undefined) {
        //         ssidtwo = "-1";
        //     }
        //
        //     if (ssidone != "-1") {
        //         param = ssidone;
        //         flag = 1;
        //     }
        //
        //     if (ssidtwo != "-1" && flag == 1) {
        //         param += "," + ssidtwo;
        //     } else {
        //         param += ssidtwo;
        //     }
        //
        //     $.ajax({
        //         url: url,
        //         type: 'get',
        //         dataType: "json",
        //         data: {
        //             vehicleId: param
        //         },
        //         success: function (data) {
        //             if (data == 'error') {
        //                 console.log("图片暂无，不能下载");
        //             } else {
        //                 window.location.href = url + "?vehicleId=" + param;
        //             }
        //         }
        //     })
        // },
        /**
         * 导出目前展示的数据
         */
        exportFile: function (url, param) {
            var paramTemp = "?";
            var n = 0;
            $.each(param, function (i, d) {
                //if (d != "") {
                if (n > 0) {
                    paramTemp += "&" + i + "=" + d
                } else {
                    paramTemp += i + "=" + d
                }
                n++;
                //}
            });
            window.location.href = url + paramTemp;
        },
        getCarInfoHtml: function () {
            return '<div class="clxx_table_item">' +
                '<label>车辆号码：</label>' +
                '<span></span>' +
                '</div>'+
                '<div class="clxx_table_item">' +
                '<label>行径点位数目：</label>' +
                '<span></span>' +
                '</div>'+
                '<div class="clxx_table_item">' +
                '<label>来源标识：</label>' +
                '<span  id="SS_PLATFORM_IDENT_TRANSLATION"></span>' +
                '</div>'+
                '<div class="clxx_table_item">' +
                '<label>号牌种类：</label>' +
                '<span  id="PLATE_CLASS_TRANSLATION"></span>' +
                '</div>'+
                '<div class="clxx_table_item">' +
                '<label>车牌颜色：</label>' +
                '<span  id="PLATE_COLOR_TRANSLATION"></span>' +
                '</div>'+
                '<div class="clxx_table_item">' +
                '<label>车辆品牌：</label>' +
                '<span  id="VEHICLE_BRAND_TRANSLATION"></span>' +
                '</div>'+
                '<div class="clxx_table_item">' +
                '<label>车辆型号：</label>' +
                '<span  id="VEHICLE_MODEL_TRANSLATION"></span>' +
                '</div>'+
                '<div class="clxx_table_item">' +
                '<label>车辆类型：</label>' +
                '<span  id="VEHICLE_CLASS_TRANSLATION"></span>' +
                '</div>'+
                '<div class="clxx_table_item">' +
                '<label>车身颜色：</label>' +
                '<span  id="VEHICLE_COLOR_TRANSLATION"></span>' +
                '</div>'+
                '<div class="clxx_table_item">' +
                '<label>行驶速度：</label>' +
                '<span  id="SPEED"></span>' +
                '</div>'+
                '<div class="clxx_table_item">' +
                '<label>行驶方向：</label>' +
                '<span  id="DIRECTION_TRANSLATION"></span>' +
                '</div>'+
                '<div class="clxx_table_item">' +
                '<label>行驶车道：</label>' +
                '<span  id="LANE_NO"></span>' +
                '</div>';
        },
        /**
         * 车辆详细信息html生成
         */
        getVehicleInfoHtml: function () {
            return '<div class="layui-row clxx-title">' +
                // '<hr/>' +
                '<p>详细信息</p>' +
                '</div>' +
                '<div class="layui-row layui-col-space10">' +
                '<div class="layui-col-md4">' +
                '来源标识<br/>' +
                '<input disabled type="text" id="SS_PLATFORM_IDENT_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                '</div>' +
                '<div class="layui-col-md4">' +
                '号牌种类<br/>' +  /*　PLATE_CLASS*/
                '<input disabled type="text" id="PLATE_CLASS_TRANSLATION"  class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                '</div>' +
                '<div class="layui-col-md4">' +
                '车牌颜色<br/>' +
                '<input disabled type="text" id="PLATE_COLOR_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                '</div>' +
                '</div>' +
                '<div class="layui-row layui-col-space10">' +
                '<div class="layui-col-md4">' +
                '车辆品牌<br/>' +
                '<input disabled type="text" id="VEHICLE_BRAND_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                '</div>' +
                '<div class="layui-col-md4">' +
                '车辆型号<br/>' +
                '<input disabled type="text" id="VEHICLE_MODEL_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                '</div>' +
                '<div class="layui-col-md4">' +
                '车辆类型<br/>' +
                '<input disabled type="text" id="VEHICLE_CLASS_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                '</div>' +
                '</div>' +
                '<div class="layui-row layui-col-space10">' +
                '<div class="layui-col-md4">' +
                '车身颜色<br/>' +
                '<input disabled type="text" id="VEHICLE_COLOR_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                '</div>' +
                // '<div class="layui-col-md4">' +
                // '挂件<br/>' +
                // '<input disabled type="text" id="PENDANT_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                // '</div>' +
                // '<div class="layui-col-md4">' +
                // '纸巾盒<br/>' +  /* TISSUE_BOX  */
                // '<input disabled type="text" id="TISSUE_BOX_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                // '</div>' +
                // '</div>' +
                // '<div class="layui-row layui-col-space10">' +
                // '<div class="layui-col-md4">' +
                // '年检标签<br/>' +
                // '<input disabled type="text" id="ANNUAL_INSPECTION_MARK" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                // '</div>' +
                // '<div class="layui-col-md4">' +
                // '行车打电话<br/>' +
                // '<input disabled type="text" id="CALLING_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                // '</div>' +
                // '<div class="layui-col-md4">' +
                // '主驾驶安全带<br/>' +
                // '<input disabled type="text" id="SAFETY_BELT_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                // '</div>' +
                // '</div>' +
                // '<div class="layui-row layui-col-space10">' +
                // '<div class="layui-col-md4">' +
                // '副驾驶安全带<br/>' +
                // '<input disabled type="text" id="VICE_SAFETY_BELT_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                // '</div>' +
                // '<div class="layui-col-md4">' +
                // '主驾驶遮阳板<br/>' +
                // '<input disabled type="text" id="SUNVISOR_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                // '</div>' +
                // '<div class="layui-col-md4">' +
                // '副驾驶遮阳板<br/>' +
                // '<input disabled type="text" id="VICE_SUNVISOR_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                // '</div>' +
                // '</div>' +
                // '<div class="layui-row layui-col-space10">' +
                '<div class="layui-col-md4">' +
                '行驶速度<br/>' +
                '<input disabled type="text" id="SPEED" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                '</div>' +
                // '<div class="layui-col-md4">' +
                // '行驶方向<br/>' +
                // '<input disabled type="text" id="DIRECTION_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                // '</div>' +
                '<div class="layui-col-md4">' +
                '行驶车道<br/>' +
                '<input disabled type="text" id="LANE_NO" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                '</div>' +
                '</div>' +
                // '<div class="layui-row layui-col-space10">' +
                // '<div class="layui-col-md4">' +
                // '黄标车<br/>' +
                // '<input disabled type="text" id="YELLOR_LABLE_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                // '</div>' +
                // '<div class="layui-col-md4">' +
                // '危险品车<br/>' +
                // '<input disabled type="text" id="DANGER_VEHICLE_TRANSLATION" class=" layui-input" required lay-verify="required" autocomplete="off"/>' +
                // '</div>' +
                '</div>';
        },
        /**
         * 车辆详细信息
         * @param ssid 车要素ID
         */
        getVehicleInfo: function (ssid) {
            $.ajax({
                type: 'get',
                url: common_picture_carPictureDetailInfo,
                dataType: 'json',
                cache: false,
                data: {
                    ssId: ssid
                },
                success: function (data) {
                    if (data.length > 0) {
                        var table = document.getElementById('detail_table_bottom');
                        $.each(data, function (i, d) {
                            $.each(table.getElementsByTagName('td'), function (n, m) {
                                if (d.tempName == $("#" + m.id + " > span").text()) {
                                    if (d.tempValue != '' && d.tempValue != null && d.tempValue != undefined && d.tempValue != "undefined") {
                                        $("#" + m.id + " > .detail-content-div").text(d.tempValue)
                                    } else {
                                        $("#" + m.id + " > .detail-content-div").text('无')
                                    }
                                }
                            });
                        });
                        /* /!*下面的方法在斟酌*!/
                         if (data[0].FACE_PHOTOS != null && data[0].FACE_PHOTOS != "") {
                             FACE_PHOTOS = data[0].FACE_PHOTOS;
                         } else {
                             $("#findPicWithPe").addClass('layui-btn-disabled');//禁用以人找图按钮
                             $("#findPeWithPic").addClass('layui-btn-disabled');//禁用以图找人按钮
                         }*/
                    }
                }, error: function (err) {
                    console.log("车辆详细：" + err)
                }
            });
        },
        /**
         * 查询详细信息，并显示，包括主副驾和车辆图片（详情面板布局为div方式，而不是table）
         * @param ssid
         */
        detailedDataInit: function (ssid) {
            $("#clxx_img").attr("src", onePicInfoShow.picAddress(picParameter.getVehicleMinPic(ssid)));
            $.ajax({
                type: 'get',
                dataType: "json",
                headers:{
                    authorization:getUrlParam("token")
                },
                data: {
                    'ssId': ssid,
                },
                url: common_picture_carPictureDetailVehicleInfo,
                success: function (data) {
                    if (data.length > 0) {
                        data = data[0];
                        $.each(data, function (i) {
                            if (data[i] != null && data[i] != 'null' && data[i] != undefined) {
                                $("#" + i).val(data[i]);
                            } else {
                                $("#" + i).val('无');
                            }
                        });
                        // $("#clxx_img").attr("src", onePicInfoShow.picAddress(picParameter.getVehicleMinPic(data.SS_ID)));
                        // if (data.ZJSSID === "") {
                        //     $("#clxx_zj_img").addClass("hide-search");
                        // } else {
                        //     $("#clxx_zj_img").removeClass("hide-search");
                        //     $("#clxx_zj_img").attr("src", onePicInfoShow.picAddress(picParameter.getVehicleMinPic(data.ZJSSID)));
                        // }
                        // if (data.FJSSID === "") {
                        //     $("#clxx_fj_img").addClass("hide-search");
                        // } else {
                        //     $("#clxx_fj_img").removeClass("hide-search");
                        //     $("#clxx_fj_img").attr("src", onePicInfoShow.picAddress(picParameter.getVehicleMinPic(data.FJSSID)));
                        // }
                        // $("#clxx_zj_img").attr("src", onePicInfoShow.picAddress(picParameter.getVehicleMinPic(data.ZJSSID === "" ? 0 : data.ZJSSID)));
                        // $("#clxx_fj_img").attr("src", onePicInfoShow.picAddress(picParameter.getVehicleMinPic(data.FJSSID === "" ? 0 : data.FJSSID)));
                    } else {
                        console.log("暂无数据！");
                    }
                },
                error: function () {
                    console.log("查询有误！");
                }
            });
        },
        /**
        * 车辆详细页面的八个按钮事件（按钮id一致时的简化版）
        *
        * @param plateNo 车辆号码
        * @param plateColor 号牌颜色
        * @param picID 主图ID
        * @param token
        * @param flag 因为当日出入城的特殊性，用于修改图片取证弹出层的宽高
        */
        initInfoButEvent: function (plateNo, plateColor, picID, token, flag) {
            publicPlateColor.functions.initBtn(plateNo, plateColor, picID,
                "infoBtn_oneCarID", "infoBtn_findPicWithCarID", "infoBtn_findPicWithPeID",
                "infoBtn_findPeWithPicID", "infoBtn_followTargetID", "infoBtn_fastReactID",
                "infoBtn_getWithPicID", "infoBtn_picStrongID", token, flag);
        },
        /**
         * 车辆详细页面的八个按钮事件
         * @param plateNo  车辆号码
         * @param plateColor  号牌颜色
         * @param imgiD  大图的ID
         * @param oneCarID   一车一档ID
         * @param findPicWithCarID  以图找车ID
         * @param findPicWithPeID   以人找图ID
         * @param findPeWithPicID   以图找人ID
         * @param followTargetID    时空分析ID
         * @param fastReactID    快速布控ID
         * @param getWithPicID     图片取证ID
         * @param picStrongID     图像增强ID
         * @param token
         * @param flag
         */
        initBtn: function (plateNo, plateColor, imgiD,
            oneCarID, findPicWithCarID, findPicWithPeID, findPeWithPicID,
            followTargetID, fastReactID, getWithPicID, picStrongID, token, flag) {
            //一车一档
            $("#" + oneCarID).off('click').on('click', function () {
                var param = {
                    plateNum: plateNo,
                    plateType: plateColor,
                    token: token,
                }
                oneCaroneDetail(param);
            });
            //以图找车
            $("#" + findPicWithCarID).off('click').on('click', function () {
                var message = {
                    src: serUrl_port7 + 'vias_app/views/vias/snapshot/motorvehicle/searchCarWithPic.html',
                    name: '以图找车',
                    params: {
                        url: encodeURIComponent($("#" + imgiD).attr('src'))
                    }
                };
                window.parent.parent.postMessage(message, '*');
            });
            //以人找图
            $("#" + findPicWithPeID).off('click').on('click', function () {
                var message = {
                    src: serUrl_port7 + 'vias_app/views/vias/snapshot/face/facetrajectory.html',
                    name: '以人找图',
                    params: {
                        url: encodeURIComponent($("#" + imgiD).attr('src'))
                    }
                }
                window.parent.parent.postMessage(message, '*');
            });
            //以图找人
            $("#" + findPeWithPicID).off('click').on('click', function () {
                var message = {
                    src: serUrl_port7 + 'vias_app/views/vias/snapshot/face/oneToNIdentification.html',
                    name: '以图找人',
                    params: {
                        url: encodeURIComponent($("#" + imgiD).attr('src'))
                    }
                }
                window.parent.parent.postMessage(message, '*');
            });
            //时空分析
            $("#" + followTargetID).off('click').on('click', function () {
                var message = {
                    src: serUrl_port7 + 'vias_app/views/vias/snapshot/timeanalysis/index.html',
                    name: '时空分析',
                    params: {
                        picurl: encodeURIComponent($("#" + imgiD).attr('src'))
                    }
                }
                window.parent.parent.postMessage(message, '*');
            });
            //快速布控
            $("#" + fastReactID).off('click').on('click', function () {
                var paramObj1 = {
                    token: '',
                    imageAddress2: encodeURIComponent($("#" + imgiD).attr('src')),
                    platNo: plateNo,
                    platColor: plateColor
                };
                fastReact.reactChoose('car', paramObj1);
            });
            //图片取证
            $("#" + getWithPicID).off('click').on('click', function () {
                getWithPicture($("#" + imgiD).attr('src'), flag); //图片取证
            });
            //图像增强
            $("#" + picStrongID).off('click').on('click', function () {
                var message = {
                    src: serUrl_port8 + 'txzqserver/txzq/index',
                    name: '图像增强',
                    params: {
                        url: encodeURIComponent($("#" + imgiD).attr('src')),
                    }
                }
                window.parent.parent.postMessage(message, '*');
            });
        },
        flowCount: function (space, param) {
            var countNum = 0;
            $.each($("#infoContainer").children(), function (i, d) {
                if ($(d).hasClass(space)) {
                    $.each($(d).children(), function (M, N) {
                        if ($(N).hasClass(param)) {
                            countNum++;
                        }
                    });
                }
            });
            return countNum;
        }
    }
}

